#include "detFinAutToRegGrammaticaTest.h"

detFinAutToRegGrammaticaTest::detFinAutToRegGrammaticaTest()
{
}

detFinAutToRegGrammaticaTest::~detFinAutToRegGrammaticaTest()
{
}

void detFinAutToRegGrammaticaTest::testProgram()
{
	cout <<endl;
	cout<<"Dfa To Regular Grammatica"<<endl << "==================================="<<endl<<endl;

	//============================================================
	//voorbeeld 2.8 uit dictaat

	list<string> finishList;
	string startList = "q0";
	finishList.push_front("q0");
	finishList.push_front("q2");
	finishList.push_front("q3");
	DetFinAut<string> detFinAut(startList, finishList);
	detFinAut.addTransition("q0", 'a', "q1");
	detFinAut.addTransition("q0", 'b', "q4");
	detFinAut.addTransition("q1", 'b', "q2");
	detFinAut.addTransition("q2", 'b', "q4");
	detFinAut.addTransition("q2", 'a', "q3");
	detFinAut.addTransition("q3", 'b', "q2");
	detFinAut.addTransition("q3", 'a', "q1");
	detFinAut.addTransition("q4", 'a', "q4");
	detFinAut.addTransition("q4", 'b', "q4");
	cout << "The DFA" <<endl; 
	detFinAut.print(6);
	cout << "" <<endl;

	
	DetFinAutToRegGrammatica regGramTest;
	RegGrammatica<string> regGram = regGramTest.detFinAutToRegGrammatica(detFinAut);
	cout << "The Regular Grammatica" <<endl;
	regGram.printLanguage(6);
	regGram.printProdRules();

}
